WebTextEditor provides a property to remove command during InitializeToolBar server side event.
In this topic, you will learn how to remove command.
To remove command during Server Side event
- Implement InitializeToolBar server side event in the WebTextEditor. Here is the snippet to remove the command using their name and position from the Standard toolbar:
C#
Copy Codeprotected void WebTextEditor1_InitializeToolBar(object sender, ISNet.WebUI.WebTextEditor.WebTextEditorToolBarArgs e) { WebTextEditorToolBar tb = e.GetToolBarByCategory(WebTextEditorToolBarCategory.Standard); WebTextEditorToolCommand cmdUndo = tb.ToolCommands.GetNamedItem("cmdUndo"); WebTextEditorToolCommand cmdRedo = tb.ToolCommands.GetNamedItem("cmdRedo"); tb.ToolCommands.RemoveAt(2); tb.ToolCommands.Remove(cmdUndo); tb.ToolCommands.Remove(cmdRedo); }